<?php
/* @var $this AdminUserController */
/* @var $model AdminUser */
/* @var $form CActiveForm */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'category-form',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('class'=>'form-horizontal', 'enctype'=>'multipart/form-data'),
    'enableAjaxValidation'=>false,
)); ?>

    <?php echo $form->errorSummary($model); ?>
    <div class="form-group">
        <label class="col-sm-2 control-label">用户名</label>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">头像</label>
        <div class="col-sm-10">
            <?php echo $form ->fileField( $model , 'avatar', array('class'=>'form-control'));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">邮箱</label>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">密码</label>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'password',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态</label>
        <div class="col-sm-10">
            <?php echo $form ->radioButtonList( $model , 'status' ,array('10'=>'正常' , '0'=>'禁用' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">角色</label>
        <div class="col-sm-10">
            <?php //var_dump( $model->adminRole );?>
            <?php echo $form ->dropDownList( $model , 'role_id', AdminUserRole::getRoles(),array('class'=>'form-control'));?>
        </div>
    </div>
    <div class="hr hr-18 dotted"></div>
    <div class="clearfix">
        <div class="col-md-offset-2 col-md-10">
            <button class="btn btn-white btn-info btn-round" type="submit"><i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>保存</button>
            &nbsp;
            <button class="btn btn-white btn-default btn-round" type="reset"><i class="ace-icon fa fa-times red2"></i>取消</button>
        </div>
    </div>
<?php $this->endWidget(); ?>
